#ifndef NOISEGATEUCS_H
#define NOISEGATEUCS_H

#include <QStyleOption>
#include <QPainter>
#include <QMouseEvent>

#include "adaptivewidgets.h"


class NoiseGateUCS : public AWidget
{
    Q_OBJECT
public:
    explicit NoiseGateUCS(QWidget *parent = nullptr);

signals:
    void thresholdChanged(int);
public slots:
    void setThreshold(const int &threshold);
protected:
    void paintEvent(QPaintEvent *event) override;

    void mousePressEvent(QMouseEvent *event) override;

    void mouseMoveEvent(QMouseEvent *event) override;

    void mouseReleaseEvent(QMouseEvent *event) override;
private:
    int toThreshold(const QPointF &point) const;
private:
    QRectF m_cRect;
    QRectF m_rectThreshold;
    QRectF m_rectRatio;
    int m_threshold;
    bool m_selected = false;
};

#endif // NOISEGATEUCS_H
